home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_300
/
333_02
/
p016.awk
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1989-04-21
|
231 b
|
10 lines
# interest2 - compute compound interest
# input: amount rate years
# output: compounded value at the end of each year
{
for (i = 1; i <= $3; i = i + 1)
printf("Year %d\t%.2f\n", i, $1 * (1 + $2) ^ i)
}